package com.indexingsystem.boss.utils;


import java.io.File;


/**
 * 多线程处理视频文件复制工具类.
 * @author Administrator
 *
 */
public class VideoCopyFileUtils
{
    private static int blockCount = 4;

    public static void videoCopyFile(String sourceFile, String targetFile)
    {

        File source = new File(sourceFile);

        long len = source.length();

        long storeNum = len / blockCount;

        for (int i = 0; i < blockCount - 1; i++ )
        {
            new StoreCopyFileThread(sourceFile, targetFile, storeNum * i, storeNum * (i + 1)).start();
        }

        new StoreCopyFileThread(sourceFile, targetFile, storeNum * (blockCount - 1), len).start();
    }
}